<?php $this; /* @var $this \Comm\View */  ?>
<?php $this->_block('content'); ?>

<?php if($categorys) : ?>
<form id="form-manage-category-result" action="<?= $this->path('aj/manage/category/destroy') ?>" class="form-inline" method="post" onsubmit="return false">
<div class="panel panel-default">

	<table class="table table-hover table-bordered">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" id="category-batch-all" name="category-batch-all" /></th>
				<th>ID</th>
				<th><?= _('名称') ?></th>
				<th><?= _('别名') ?></th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($categorys as $value) : ?>
			<tr>
				<td><?php if($value['uid'] == Yaf_Registry::get('current_uid')) : ?><input type="checkbox" name="ids[]" value="<?= $value['id'] ?>" /><?php endif; ?></td>
				<td><?= $value['id'] ?></td>
				<td><?= $value['name'] ?></td>
				<td><?= $value['alias'] ?></td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>

	<div class="panel-footer">
		<input type="submit" class="btn btn-default" value="批量删除" />
		<a class="btn btn-default" href="javascript:$.alert('该功能开发中。')" role="button">更新排序</a>
	</div>
</div>
</form>
<?php endif; ?>
<form id="form-manage-category-create" action="<?= $this->path('aj/manage/category/create') ?>" class="form-inline" method="post" onsubmit="return false">
<div class="panel panel-info">
	<div class="panel-body">
		<div class="form-group">
			<label class="sr-only" for="form-input-name"></label>
			<div class="input-group">
				<div class="input-group-addon"><?= _('名称') ?></div>
				<input type="text" class="form-control" id="form-input-name" name="name" placeholder="分类名称">
			</div>
		</div>
		<div class="form-group">
			<label class="sr-only" for="form-input-alias"></label>
			<div class="input-group">
				<div class="input-group-addon"><?= _('别名') ?></div>
				<input type="text" class="form-control" id="form-input-alias" name="alias" placeholder="用于URL展示">
			</div>
		</div>
		<input type="submit" class="btn btn-info" value="创建分类" />
	</div>
</div>
</form>

<?php $this->_blockEnd(); ?>
<?php $this->_block('body_end')?>
<?php $this->js('manage/category.js'); ?>
<?php $this->_blockEnd()?>
<?php $this->_blockLoad('_block/manage', ['nav'=>'category']) ?>